Skip to content

One vector for regexes and matchers#133

Draft
IhateTrains wants to merge 11 commits intoParadoxGameConverters:masterfrom
IhateTrains:parser-test2
Draft

One vector for regexes and matchers#133
IhateTrains wants to merge 11 commits intoParadoxGameConverters:masterfrom
IhateTrains:parser-test2

Conversation

@IhateTrains
Copy link
Copy Markdown
Member

  • Removed unneeded escaping backslashes in regexes
  • Fixed parsing being broken by registerRegex and registerMatcher using separate vectors. They now use one registeredRegexesAndMatchers vector
  • StreamOnly versions of registerRegex and registerMatcher
  • Purge of "unused" in ParserHelpers

@IhateTrains IhateTrains changed the title Parser test2 One vector for regexes and matchers Feb 15, 2021
@Idhrendur
Copy link
Copy Markdown
Member

I like where you're gong with this, but I think the modern idiom is to use std::variant and std::visit instead of inheritance: https://www.bfilipek.com/2020/04/variant-virtual-polymorphism.html

Can you put together another PR on a different branch using that method and see how feasible it is?

And maybe split out the cleanup efforts to a new PR so we can just get things merged.

@Idhrendur Idhrendur reopened this Feb 18, 2021
@Idhrendur
Copy link
Copy Markdown
Member

I'm not sure we should give up on this. I'd like more time to compare to how the std::variant version came out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants